 <?php  echo CHtml::scriptFile('/js/user.js'); ?>
<p class="help-block">Fields with <span class="required">*</span> are required.</p>
<p style="padding:5px;"><label for="pic" class="">Picture<span class="required">*</span></label></p>
<div style="width:410px;">
<?php
    if(!empty($model->thumb)){
         $pic = $model->thumb;
    }else{
         $pic = '/uploads/thumb/preview.jpg';
    }
    $this->widget('ext.imageSelect.ImageSelect',  array(
                  'path'=>$pic,
                  'alt'=>'Upload Image',
                  'text'=>'Click for upload',
                  'uploadUrl'=>'/picture/upload',
                  'htmlOptions'=>array()
    ));
 ?>
</div>
<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
	'id'=>'picture-form',
	'enableAjaxValidation'=>false,
)); ?>

<?php echo $form->errorSummary($model); ?>

<input type="hidden" value="<?php echo $model->thumb; ?>" id="Picture_thumb" name="Picture[thumb]"  class="span3"/>

<?php echo $form->textFieldRow($model,'title',array('class'=>'span5','maxlength'=>150)); ?>

<?php 
      echo $form->dropDownListRow($model,'album_id',
           Album::model()->getAlbumCotegory(),
           array('prompt'=>'Select Album Category','class'=>'span5')); 

?>

<div class="form-actions">
        <?php $this->widget('bootstrap.widgets.TbButton', array(
                'buttonType'=>'submit',
                'type'=>'primary',
                'htmlOptions'=>array('id'=>'picture_button'),
                'label'=>$model->isNewRecord ? 'Create' : 'Save',
        )); ?>
</div>

<?php $this->endWidget(); ?>
